package com.exam.common.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.exam.common.pojo.BaseTopic;
import com.exam.common.dao.BaseTopicMapper;
import com.exam.common.service.IBaseTopicService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 * 基础题库 服务实现类
 * </p>
 *
 * @author rock
 * @since 2021-11-15
 */
@Service
public class BaseTopicServiceImpl  implements IBaseTopicService {

    @Autowired(required = false)
    BaseTopicMapper baseTopicMapper;

    @Override
    public HashMap<String, Object> selectTopic(Integer[] arr) {

        HashMap<String,Object> map=new HashMap<>();
        QueryWrapper<BaseTopic> queryWrapper=new QueryWrapper<>();
        queryWrapper.in("topic_id",arr);

        List<BaseTopic> baseTopics = baseTopicMapper.selectList(queryWrapper);
        map.put("list",baseTopics);
        return map;
    }
}
